// START OF Advanced SmartSource Data Collector TAG
// Copyright (c) 1996-2046 WebTrends Inc. All rights reserved.
// jQueryDateTime: 2009/04/02 14:11:22 jQuery

function getDomain(url) {
	var domain;
	domain = url.split('.com/');
	if (domain[1] == undefined) domain[1] = '';
	return domain[1];
}

var url = location.href;
var parentUrl = document.referrer;

if (url == 'http://new.masamaso.com/' || url == 'http://new.masamaso.com' || url == 'http://www.masamaso.com/' || url == 'http://www.masamaso.com') url = 'http://www.masamaso.com/index.php';
if (parentUrl == 'http://new.masamaso.com/' || parentUrl == 'http://new.masamaso.com' || parentUrl == 'http://www.masamaso.com/' || parentUrl == 'http://www.masamaso.com') parentUrl = 'http://www.masamaso.com/index.php';
if (url.indexOf('com/?from') >= 0) url = 'http://www.masamaso.com/index.php';
//if (parentUrl.indexOf('masamaso.com/?from') >= 0) parentUrl = 'http://www.masamaso.com/index.php';

url = url.split('?');  //当前页地址
var parentUrl = parentUrl.split('?');	//上一页地址

var previous = getDomain(parentUrl[0]);	//上一页文件名

if (parentUrl[1]==undefined) var previous_param = '';
else var previous_param = parentUrl[1]	//上一页参数

var current = getDomain(url[0]);	//当前页名称
if (url[1]==undefined) var current_param = '';
else var current_param = url[1];	//当前页参数
if (current == '') current = 'index.php';

//判断是不是折扣街
var domain = 'masamaso';
if (url[0].indexOf('tenpay') >= 0) {
//	current = 't_'+current;
//	if (previous != '') previous = 't_'+previous;
	domain = 'tenpay';
}
else if (url[0].indexOf('tianya') >= 0) {
	domain = 'tianya';
}

//if (current != '') {
	document.write('<iframe id="delIframe" height="0" width="0" src=""></iframe>');
	document.getElementById('delIframe').src = 'http://www.masamaso.com/union/operate/visitor_path.php?previous='+escape(previous)+'&previous_param='+escape(previous_param)+'&current='+escape(current)+'&current_param='+escape(current_param)+'&domain='+domain;
//	document.write('<iframe id="delIframe1" height="0" width="0" src=""></iframe>'); 
//	document.getElementById('delIframe1').src = 'http://www.masamaso.com/reg_click.php'; 
//====================================上线后需改成绝对路径======================================================
//}

/**
 * 点击统计
 */
var click_code = location.href.split('path=');
if (click_code[1] != undefined && click_code[1] != '') {
	document.write('<iframe id="delIframe2" height="0" width="0" src=""></iframe>');
	document.getElementById('delIframe').src = 'clickstat.php?path='+click_code[1]; 
}
// END OF Basic SmartSource Data Collector TAG
